package com.wlq.service.controller;


import com.wlq.service.service.AtService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class AtController {

    private final static Logger logger = LoggerFactory.getLogger(AtController.class);

    @Autowired
    AtService atService;

    @PostMapping("/at-insert")
    public String insert(@RequestBody Map<String, Object> params) {
        String s = "";
        // 这里加try模拟下游服务的降级处理
        try {
            s = atService.insert(params);
        } catch (Exception e) {
            logger.error("at 服务异常", e);
        }
        return s;
    }


}
